//
//  PhoneQueryViewController.m
//  SmartLife
//
//  Created by Lawrence on 15/10/13.
//  Copyright © 2015年 Lawrence. All rights reserved.
//

#import "PhoneQueryViewController.h"
#import "HttpRequest.h"
#import <MBProgressHUD.h>

static NSString  *Phone_Query_url=@"http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=％@";

@interface PhoneQueryViewController ()
@end

@implementation PhoneQueryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.delegate=self;
    self.tableView.dataSource=self;
    self.searchBar.delegate=self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell=[[UITableViewCell alloc] init];
    return cell;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 7;
}
-(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{
    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
        NSDictionary *dict=[HttpRequest initWithUrl:[NSString stringWithFormat:Phone_Query_url,self.searchBar.text]];
        dispatch_async(dispatch_get_main_queue(), ^{
            if (dict!=nil) {
                
            }
            [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
        });
    });
}
@end
